<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="js/jquery.min.js"></script>
<script src="lib/marked.min.js"></script>
<script src="lib/prettify.min.js"></script>
<script src="lib/raphael.min.js"></script>
<script src="lib/underscore.min.js"></script>
<script src="lib/sequence-diagram.min.js"></script>
<script src="lib/flowchart.min.js"></script>
<script src="lib/jquery.flowchart.min.js"></script>
<script src="js/editormd.min.js"></script>

<div id="doc-content">
    <textarea style="display:none;"></textarea>
</div>

<script type="text/javascript">
    var testEditor;
    $(function () {
        $.ajax({
            url : "http://localhost:8080/select",
            async : true,
            data:{},
            dataType : 'json',
            type : 'get',
            beforesend:function(){　//　请求前的处理
                testEditor = editormd.markdownToHTML("doc-content", {//注意：这里是上面DIV的id
                    htmlDecode: "style,script,iframe",
                    emoji: true,
                    taskList: true,
                    flowChart: true, // 默认不解析
                    codeFold: true,
                });
            },
            success : function(msg) {
                alert(msg.detail);
                //业务控制
                if(msg != null){
                    $("#doc-content").html(msg.detail+"");
                }else{
                    alert("无法显示！");
                }
            }
        });

    });
</script>
</body>
</html>